syn keyword AspVBSFunction contained Chr CInt CLng Cos CreateObject CSng CStr Date
syn keyword AspVBSFunction contained DateAdd DateDiff DatePart DateSerial DateValue
syn keyword AspVBSFunction contained Day Exp Filter Fix FormatCurrency
syn keyword AspVBSFunction contained FormatDateTime FormatNumber FormatPercent
syn keyword AspVBSFunction contained GetObject Hex Hour InputBox InStr InStrRev Int
syn keyword AspVBSFunction contained IsArray IsDate IsEmpty IsNull IsNumeric
syn keyword AspVBSFunction contained IsObject Join LBound LCase Left Len LoadPicture
syn keyword AspVBSFunction contained Log LTrim Mid Minute Month MonthName MsgBox Now
syn keyword AspVBSFunction contained Oct Replace RGB Right Rnd Round RTrim
syn keyword AspVBSFunction contained ScriptEngine ScriptEngineBuildVersion
syn keyword AspVBSFunction contained ScriptEngineMajorVersion
syn keyword AspVBSFunction contained ScriptEngineMinorVersion Second Sgn Sin Space
syn keyword AspVBSFunction contained Split Sqr StrComp StrReverse String Tan Time
syn keyword AspVBSFunction contained TimeSerial TimeValue Trim TypeName UBound UCase
syn keyword AspVBSFunction contained VarType Weekday WeekdayName Year
" AspVBScript Methods
syn keyword AspVBSMethods contained Add AddFolders BuildPath Clear Close Copy
syn keyword AspVBSMethods contained CopyFile CopyFolder CreateFolder CreateTextFile
syn keyword AspVBSMethods contained Delete DeleteFile DeleteFolder DriveExists
syn keyword AspVBSMethods contained Exists FileExists FolderExists
syn keyword AspVBSMethods contained GetAbsolutePathName GetBaseName GetDrive
syn keyword AspVBSMethods contained GetDriveName GetExtensionName GetFile
syn keyword AspVBSMethods contained GetFileName GetFolder GetParentFolderName
syn keyword AspVBSMethods contained GetSpecialFolder GetTempName Items Keys Move
syn keyword AspVBSMethods contained MoveFile MoveFolder OpenAsTextStream
syn keyword AspVBSMethods contained OpenTextFile Raise Read ReadAll ReadLine Remove
syn keyword AspVBSMethods contained RemoveAll Skip SkipLine Write WriteBlankLines
syn keyword AspVBSMethods contained WriteLine
" AspVBScript Number Contstants
" Integer number, or floating point number without a dot.
syn match AspVBSNumber contained "\<\d\+\>"
" Floating point number, with dot
syn match AspVBSNumber contained "\<\d\+\.\d*\>"
" Floating point number, starting with a dot
syn match AspVBSNumber contained "\.\d\+\>"
" String and Character Contstants
" removed (skip=+\\\\\|\\"+) because VB doesn't have backslash escaping in
" strings (or does it?)
syn region AspVBSString contained start=+"+ end=+"+ keepend
" AspVBScript Comments
syn region AspVBSComment contained start="^REM\s\|\sREM\s" end="$" contains=AspVBSTodo keepend
syn region AspVBSComment contained start="^'\|\s'" end="$" contains=AspVBSTodo keepend
" misc. Commenting Stuff
syn keyword AspVBSTodo contained TODO FIXME
" Cosmetic syntax errors commanly found in VB but not in AspVBScript
" AspVBScript doesn't use line numbers
syn region AspVBSError contained start="^\d" end="\s" keepend
" AspVBScript also doesn't have type defining variables
syn match AspVBSError contained "[a-zA-Z0-9_][\$&!#]"ms=s+1
" Since 'a%' is a VB variable with a type and in AspVBScript you can have 'a%>'
" I have to make a special case so 'a%>' won't show as an error.
syn match AspVBSError contained "[a-zA-Z0-9_]%\($\|[^>]\)"ms=s+1
" Top Cluster
syn cluster AspVBScriptTop contains=AspVBSStatement,AspVBSFunction,AspVBSMethods,AspVBSNumber,AspVBSString,AspVBSComment,AspVBSError
" Define AspVBScript delimeters
" <%= func("string_with_%>_in_it") %> This is illegal in ASP syntax.
syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%=\=+ end=+%>+ contains=@AspVBScriptTop
syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<script\s\+language="\=vbscript"\=[^>]*\s\+runatserver[^>]*>+ end=+</script>+ contains=@AspVBScriptTop
" Synchronization
syn sync match AspVBSSyncGroup grouphere AspVBScriptInsideHtmlTags "<%"
" This is a kludge so the HTML will sync properly
syn sync match htmlHighlight groupthere htmlTag "%>"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_aspvbs_syn_inits")